//
//  SecondTableViewCell.m
//  A段项目音乐播放
//
//  Created by dllo on 15/5/23.
//  Copyright (c) 2015年 lanou3g.com蓝鸥科技. All rights reserved.
//

#import "SecondTableViewCell.h"
#import "firstModel.h"
#import "UIImageView+WebCache.h"
#import "MyImageView.h"
@implementation SecondTableViewCell

- (void)awakeFromNib
{
    // Initialization code
}

-(void)dealloc
{
    
    [_rightimageview release];
    [_labelone release];
    [_labeltwo release];
    [_midimageview release];
    [_leftimageview release];
    [super dealloc];
    
    
    
    
    
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        
        [self creataimage];
    }
    
    return self;
    
}


-(void)creataimage
{
    self.rightimageview =[[MyImageView alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/30-10, 10,[UIScreen mainScreen].bounds.size.width/3-10,[UIScreen mainScreen].bounds.size.width/3+10)];
    self.rightimageview.userInteractionEnabled =YES;
    self.rightimageview.layer.cornerRadius =10;
    self.rightimageview.clipsToBounds =YES;
    UITapGestureRecognizer *rightTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchImage:)];
    [self.rightimageview addGestureRecognizer:rightTap];
    [self.contentView addSubview:self.rightimageview];

    self.midimageview =[[MyImageView alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/3, 10, [UIScreen mainScreen].bounds.size.width/3-10, [UIScreen mainScreen].bounds.size.width/3+10)];
    self.midimageview.userInteractionEnabled =YES;
    self.midimageview.layer.cornerRadius =10;
    self.midimageview.clipsToBounds =YES;
     UITapGestureRecognizer *midTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchImage:)];
    
    [self.midimageview addGestureRecognizer:midTap];
    [self.contentView addSubview:self.midimageview];

    self.leftimageview =[[MyImageView alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/3+10+[UIScreen mainScreen].bounds.size.width/3-10,10,[UIScreen mainScreen].bounds.size.width/3-10,[UIScreen mainScreen].bounds.size.width/3+10)];
    self.leftimageview.userInteractionEnabled =YES;
    self.leftimageview.layer.cornerRadius =10;
    self.leftimageview.clipsToBounds =YES;
     UITapGestureRecognizer *leftTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchImage:)];
    [self.leftimageview addGestureRecognizer:leftTap];
    [self.contentView addSubview:self.leftimageview];

    [self.rightimageview release];
    [self.midimageview release];
    [self.leftimageview release];

}

- (void)touchImage:(UITapGestureRecognizer *)tap
{
    MyImageView *image = (MyImageView *)tap.view;
    
    [self.delegate imageAction:image];
}
-(void)setrightModel:(firstModel *)rightModel midModel:(firstModel *)midModel leftModel:(firstModel *)leftModel
{
    self.rightimageview.model =rightModel;
    self.midimageview.model =midModel;
    self.leftimageview.model=leftModel;
    [self.rightimageview sd_setImageWithURL:[NSURL URLWithString:rightModel.pic_url] placeholderImage:nil];
    [self.midimageview sd_setImageWithURL:[NSURL URLWithString:midModel.pic_url] placeholderImage:nil];
    [self.leftimageview sd_setImageWithURL:[NSURL URLWithString:leftModel.pic_url] placeholderImage:nil];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
